package com.cmsky.open.web;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
/**
 * 需要移到security权限模块
 * @author tananlin
 *
 */
public class SecurityFilter implements Filter{
	protected static final Logger logger = Logger.getLogger(SecurityFilter.class);
	protected String[] notFiltersArray;
	public void destroy() {
	}

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chains) throws IOException, ServletException {
		HttpServletRequest req = (HttpServletRequest) request;
		String path = req.getRequestURI();
		
		logger.info(path+"<|>测试人员");
		chains.doFilter(request, response);
	}

	public void init(FilterConfig config) throws ServletException {
		String notFilters = config.getInitParameter("notFilters");
		if(StringUtils.isNotBlank(notFilters)){
			notFiltersArray = notFilters.split(";");
		}
	}

}
